import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '应用名称',
    align:"center",
    dataIndex: 'appName'
   },
   {
    title: '启动图',
    align:"center",
    dataIndex: 'mainImage_dictText'
   },
   {
    title: '背景图',
    align:"center",
    dataIndex: 'backgroundImage_dictText'
   },
   {
    title: '启动文字',
    align:"center",
    dataIndex: 'mainWork'
   },
   {
    title: '故事线默认图',
    align:"center",
    dataIndex: 'storyImage_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "应用名称",
      field: 'appName',
      component: 'Input',
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '应用名称',
    field: 'appName',
    component: 'Input',
  },
  {
    label: '启动图',
    field: 'mainImage',
    component: 'JSearchSelect',
    componentProps:{
       dict:"m_resource,name,id"
    },
  },
  {
    label: '背景图',
    field: 'backgroundImage',
    component: 'JSearchSelect',
    componentProps:{
       dict:"m_resource,name,id"
    },
  },
  {
    label: '启动文字',
    field: 'mainWork',
    component: 'Input',
  },
  {
    label: '故事线默认图',
    field: 'storyImage',
    component: 'JSearchSelect',
    componentProps:{
       dict:"m_resource,name,id"
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  appName: {title: '应用名称',order: 0,view: 'text', type: 'string',},
  mainImage: {title: '启动图',order: 1,view: 'sel_search', type: 'string',dictTable: "m_resource", dictCode: 'id', dictText: 'name',},
  backgroundImage: {title: '背景图',order: 2,view: 'sel_search', type: 'string',dictTable: "m_resource", dictCode: 'id', dictText: 'name',},
  mainWork: {title: '启动文字',order: 3,view: 'text', type: 'string',},
  storyImage: {title: '故事线默认图',order: 4,view: 'sel_search', type: 'string',dictTable: "m_resource", dictCode: 'id', dictText: 'name',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}